import loadable from '@/utils/loadable'

const Index = loadable(() => import(/* webpackChunkName: 'index' */ '@/views/Index'))

const NewList = loadable(() => import(/* webpackChunkName: 'button' */ '@/views/New/NewList'))
const CreateNew = loadable(() => import(/* webpackChunkName: 'icon' */ '@/views/New/CreateNew'))
const ContentView = loadable(() => import(/* webpackChunkName: 'icon' */ '@/views/New/NewContent'))
const UpdateNewView = loadable(() => import(/* webpackChunkName: 'icon' */ '@/views/New/UpdateNew'))
const About = loadable(() => import(/* webpackChunkName: 'about' */ '@/views/About'))

const UserList = loadable(() => import(/* webpackChunkName: 'about' */ '@/views/User/List'))
const UserMy = loadable(() => import(/* webpackChunkName: 'about' */ '@/views/User/My'))
const MySet = loadable(() => import(/* webpackChunkName: 'about' */ '@/views/User/My/Set'))

const routes = [
    { path: '/index', exact: true, name: 'Index', component: Index, role: [1] },
    { path: '/user/list', exact: true, name: 'Index', component: UserList, role: [1] },
    { path: '/user/my', exact: true, name: 'Index', component: UserMy, role: [1] },
    { path: '/user/my/set', exact: true, name: 'Index', component: MySet, role: [1] },
    { path: '/news/list', exact: false, name: '新闻列表', component: NewList, role: [1] },
    { path: '/news/release', exact: false, name: '发布新闻', component: CreateNew, role: [1] },
    { path: '/news/new-content', exact: false, name: '新闻详情', component: ContentView, role: [1] },
    { path: '/news/update-new', exact: false, name: '修改新闻', component: UpdateNewView, role: [1] },
    { path: '/about', exact: false, name: '关于', component: About, role: [1] }
]

export default routes
